package nccloud.web.hrpbm.sjxm.sjxmh.action;
import nccloud.commons.lang.StringUtils;
import nccloud.web.codeplatform.framework.action.base.BaseAction;
import nccloud.web.codeplatform.framework.action.base.RequstParamWapper;
import nccloud.web.codeplatform.framework.action.base.VOTransform;
import nccloud.web.codeplatform.framework.action.base.RequestDTO;
import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.container.IRequest;
import nccloud.framework.core.exception.BusinessException;
import nc.vo.sjxm.sjxm.AggSjxmVO;
import nc.itf.hrpbm.sjxm.sjxmh.ISjxmHVOService;
/**
 * 卡片查询
 */
public class LoadSjxmHVOAction extends BaseAction{

	@Override
	public Object doAction(IRequest request, RequstParamWapper paramWapper) throws Throwable{
		RequestDTO param = VOTransform.toVO(paramWapper.requestString,RequestDTO.class);
		
		String pk = param.getPk();
		if(StringUtils.isEmpty(pk)){
			throw new BusinessException("参数中缺少pk参数，请检查代码！");
		}
		ISjxmHVOService service = ServiceLocator.find(ISjxmHVOService.class);
		
		AggSjxmVO vo = service.findAggSjxmVOByPk(pk);
		if(vo == null){
			throw new BusinessException("没有查到对应的数据，请重试");
		}
		
		return buildResult(param,true,null,vo);
	}
}
